package com.yf.course.modules.course.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yf.course.modules.course.dto.CourseFileLearnDTO;
import com.yf.course.modules.course.dto.response.CourseFileLearnRespDTO;
import com.yf.course.modules.course.entity.CourseFileLearn;
import org.apache.ibatis.annotations.Param;

/**
* <p>
* 课件学习Mapper
* </p>
*
* @author 聪明笨狗
* @since 2020-12-17 11:28
*/
public interface CourseFileLearnMapper extends BaseMapper<CourseFileLearn> {

    /**
     * 学习记录分页
     * @param page
     * @param query
     * @return
     */
    IPage<CourseFileLearnRespDTO> paging(Page page, @Param("query") CourseFileLearnDTO query);

    /**
     * 统计已学完的课件数量
     * @param userId
     * @param courseId
     * @return
     */
    Integer countFinished(@Param("userId") String userId,
                          @Param("courseId") String courseId);
}
